# apps/light_theme/light_theme/utils/__init__.py
import frappe

def get_loader_config():
    """带错误处理的配置获取"""
    try:
        return {
            "enable_loader": frappe.db.get_single_value(
                "Light Theme Settings", 
                "enable_page_loader"
            ) or 1,
            "animation_speed": 1.5
        }
    except:
        return {"enable_loader": 1, "animation_speed": 1.5}  # 降级默认值